<?php
session_start();
if(!@$_SESSION['username']) {
  echo "<script>window.location.href='login.php';</script>";
}
?><!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/font-awesome/font-awesome.min.css" rel="stylesheet" type="text/css" />
<!--[if IE 7]>
<link href="lib/font-awesome/font-awesome-ie7.min.css" rel="stylesheet" type="text/css" />
<![endif]-->
<link href="lib/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]--><title>订单详情</title>
</head>
<body>

<?php
  //获取全部数据
  include_once('libraries/esaydb.class.php');
  $db = new EasyDB();
  if($_GET) {
    $rid = $_GET['rid'];
    $sql = "SELECT * FROM ob_order as a, ob_station as b  WHERE a.sid = b.id AND rid = ?";
    $result = $db->queryOne($sql,array($rid));
  }else{
    $sql = "SELECT * FROM ob_order as a, ob_station as b  WHERE a.sid = b.id AND uid = ?";
    $result = $db->queryOne($sql,array($_SESSION['uid']));
  }



  // foreach ($result as $result) {
?>
<div class="cl pd-20" style=" background-color:#5bacb6">
  <img class="avatar size-XL l" src="images/user.png">
  <dl style="margin-left:80px; color:#fff">
    <dt><span class="f-18"><?php echo $result['name']; ?></span> <span class="pl-10 f-12">座位类型：<?php if($result['site_type'] == 'have') echo "有座"; else echo "无座"; ?></span></dt>
    <dd class="pt-10 f-12" style="margin-left:0"><?php echo "出发地：".$result['station_start']." ===> 目的地: ".$result['station_end']; ?></dd>
  </dl>
</div>
<div class="pd-20">
  <table class="table">
    <tbody>
      <tr>
        <th class="text-r" width="80">邮箱：</th>
        <td><?php echo $result['email']; ?></td>
      </tr>
      <tr>
        <th class="text-r">手机：</th>
        <td><?php echo $result['telphone']; ?></td>
      </tr>
      <tr>
        <th class="text-r">身份证号：</th>
        <td><?php echo $result['idcard']; ?></td>
      </tr>
      <tr>
        <th class="text-r">车次：</th>
        <td><?php echo $result['sid']; ?></td>
      </tr>
      <tr>
        <th class="text-r">出发时间：</th>
        <td><?php echo $result['time_start']; ?></td>
      </tr>
      <tr>
        <th class="text-r">到达时间：</th>
        <td><?php echo $result['time_end']; ?></td>
      </tr>
    </tbody>

  </table>
</div>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/H-ui.js"></script>
<script type="text/javascript" src="js/H-ui.admin.js"></script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?080836300300be57b7f34f4b3e97d911";
  var s = document.getElementsByTagName("script")[0];
  s.parentNode.insertBefore(hm, s);
})();
var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F080836300300be57b7f34f4b3e97d911' type='text/javascript'%3E%3C/script%3E"));
</script>
<?php
// }
    ?>
</body>
</html>
